﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace zielonka.co.uk.extensions.system.security
{
    //Description:	Converts a string into a "SecureString"
    /*
        String password = "mypassword";
        System.Security.SecureString secure = password.ToSecureString();
    */

    public static partial class StringExtensions
    {
        public static System.Security.SecureString ToSecureString(this String str)
        {
            System.Security.SecureString secureString = new System.Security.SecureString();
            foreach (Char c in str)
                secureString.AppendChar(c);

            return secureString;
        }
    }
}
